﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace GameJamKingdom
{
    class CoinBlock:GridObject
    {
        Texture2D emptyTex;
        AnimatedComponent coinAnim;

        public CoinBlock(Game1 cGame)
        {
            type = "coin";
            maxPerColumn = 3;
            coinAnim = new AnimatedComponent("goldScaleAnim", "GoldScale", 9, 15, cGame);
            emptyTex = cGame.Content.Load<Texture2D>("scaleTileV3");
        }

        public override void update(GameTime cTime)
        {
            coinAnim.update(cTime);
        }

        public override void render(Rectangle cRect, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(emptyTex, cRect, Color.White);
            coinAnim.render(cRect, spriteBatch);
        }

        public override bool testTime(Mode cMode, int lastTime)
        {
            if (lastTime > cMode.speed)
                return true;
            else
                return false;
        }
    }
}
